package com.rnkrsoft.suyan.config.internal.enums;

import com.rnkrsoft.interfaces.EnumIntegerCode;

/**
 * Created by woate on 2018/6/17.
 */
public enum FileStatusEnum implements EnumIntegerCode {
    NORMAL(1, "正常"),
    DELETE(-1, "删除");

    FileStatusEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    int code;
    String desc;

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static FileStatusEnum valueOfCode(int code) {
        for (FileStatusEnum value : values()) {
            if (value.code == code) {
                return value;
            }
        }
        throw new IllegalArgumentException("illegal code " + code);
    }
}
